<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>商品管理</h2>
	</div>
	<div class="tools auth-botton">
        <a class="btn" href="{:U('createGoods')}">新 增</a>
        <button class="btn ajax-post" url="{:U('changeStatus?method=resumegoods')}" target-form="ids">启 用</button>
        <button class="btn ajax-post" url="{:U('changeStatus?method=forbidgoods')}" target-form="ids">禁 用</button>
        <button class="btn ajax-post confirm" url="{:U('changeStatus?method=deletegoods')}" target-form="ids">删 除</button>
	</div>
	<div class="tab-wrap">
		<ul id="typetab" class="tab-nav nav">
			<volist name="typelist" id="type">
				<li <eq name="id" value="$type[id]"> class="current"</eq>><a href="{:U('?id='.$type[id])}">{$type.name}</a></li>
			</volist>
		</ul>
	</div>
	<!-- 数据列表 -->
    <div class="data-table table-striped">
	    <table class="">
	    	<thead>
	    		<tr>
	    			<th class="row_selected row-selected"><input type="checkbox" class="check-all"></th>
	    			<th class="">ID</th>
	    			<th class="">排序</th>
	    			<!-- <th class="">商品编号</th> -->
	    			<th class="">商品名称</th>
	    			<th class="">备注</th>
	    			<th class="">状态</th>
	    			<th class="">操作</th>
	    		</tr>
	    	</thead>
	    	<tbody>
	    		<notempty name="_list">
	    		<volist name="_list" id="vo">
	    		<tr>
	    			<td><input type="checkbox" class="ids" name="id[]" value="{$vo.id}"></td>
	    			<td>{$vo.id}</td>
	    			<td>{$vo.sort}</td>
	    			<!-- <td>{$vo.num}</td> -->
	    			<td>{$vo.name}</td>
	    			<td>{$vo.remark}</td>
	    			<td>{$vo.status_text}</td>
	    			<td>
	    			<eq name="vo.status" value="1">
					<a href="{:U('Goods/changeStatus?method=forbidgoods&id='.$vo['id'])}" class="ajax-get">禁用</a>
					<else/>
					<a href="{:U('Goods/changeStatus?method=resumegoods&id='.$vo['id'])}" class="ajax-get">启用</a>
					</eq>
					<a href="{:U('Goods/goodsspec?gid='.$vo['id'])}">规格</a>
					<a href="{:U('Goods/edit?id='.$vo['id'])}">编辑</a>
	    			<a href="{:U('Goods/changeStatus?method=deletegoods&id='.$vo['id'])}" class="confirm ajax-get">删除</a></td>
	    		</tr>
	    		</volist>
	    		<else/>
	    		<td colspan="7" class="text-center">暂时还没有数据！</td>
	    		</notempty>
	    	</tbody>
	    </table>
	    <div class="page">
	    	{$_page}
	    </div>
    </div>
</block>

<block name="script">
	<script type="text/javascript">
    //导航高亮
    highlight_subnav('{:U('Goods/index')}');
	</script>
</block>